package 原型模式.应用;

import java.io.Serializable;

/**
 * @author wzx
 * @date 2024/9/5 17:26
 * @description: 邮件类
 */
public class Mail implements Cloneable , Serializable {
    // 收件人
    private String receiver;

    // 邮件名称
    private String subject;

    // 称呼
    private String appellation;

    // 邮件内容
    private String context;

    // 邮件尾部 ”xx版权所有“
    private String tail;

    public Mail(AdvTemplate advTemplate) {
        this.context = advTemplate.getAdvContext();
        this.subject = advTemplate.getAdvSubject();
    }

    public String getReceiver() {
        return receiver;
    }

    public void setReceiver(String receiver) {
        this.receiver = receiver;
    }

    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    public String getAppellation() {
        return appellation;
    }

    public void setAppellation(String appellation) {
        this.appellation = appellation;
    }

    public String getContext() {
        return context;
    }

    public void setContext(String context) {
        this.context = context;
    }

    public String getTail() {
        return tail;
    }

    public void setTail(String tail) {
        this.tail = tail;
    }

    @Override
    protected Mail clone() {
        Mail mail = null;
        try {
            return (Mail)super.clone();
        }catch (CloneNotSupportedException e){
            return null;
        }
    }
}
